<template>
  <div class="pc-class">
    <!-- 单个图片详细信息页面 -->
    <van-cell>
        <!-- 标题区域的插槽 -->
      <template #title>
        <!-- 参数路由 -->
          <router-link :to="'/pictureinfo/'+ id">
            <div class="title-box">
              <!-- 标题 -->
              <span>{{title}}</span>
              <!-- 图片 -->
              <img :src="picture" alt="" class="thumb">
            </div>
          </router-link>
      </template>

      <!-- label 区域的插槽 -->
      <template #label>
        <div class="label-box">
          <span>{{author}} &nbsp;&nbsp; {{title}}</span>
          <span>{{view}}</span>
        </div>
      </template>
    </van-cell>
  </div>
</template>

<script>
export default {
  name: 'PictureInfo',
  // 父传子接收数据
  props: {
    title: {
      type: String,
      default: ''
    },
    author: {
      type: String,
      default: ''
    },
    picture: {
      type: String,
      default: ''
    },
    is_delete: {
      type: Number,
      default: 0
    },
    id: {
      type: Number,
      default: 0
    },
    view: {
      type: Number,
      default: 0
    }
  }
}
</script>

<style lang="less" scoped>
.label-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.thumb {
  // 矩形黄金比例：0.618
  width: auto;
  height: 150px;
  background-color: #f8f8f8;
  object-fit: cover;
}
.title-box {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  color: black;
}

.thumb-box {
  display: flex;
  justify-content: space-between;
}
a{
    color: black;
    text-decoration: none;
  }
  @media screen and (min-width: 1280px) {
    .pc-class{
      width: 40%;
      display: inline-flex;
      flex: left;
      justify-content: space-between;
    }
  }
</style>
